@echo off
echo ========================================
echo 测试用户3的设备API
echo ========================================

echo.
echo 1. 测试API连接...
powershell -Command "try { $result = Invoke-RestMethod -Uri 'http://localhost:8081/api/devices/user/3' -Method GET; Write-Host 'API调用成功'; Write-Host '返回数据类型:' $result.GetType().Name; Write-Host '数据内容:' $result } catch { Write-Host 'API调用失败:' $_.Exception.Message }"

echo.
echo.
echo 2. 检查数据库中的设备...
mysql -u root -p100861100 -e "USE home_control_center; SELECT id, name, device_type_id, user_id, room FROM devices WHERE user_id = 3;"

echo.
echo.
echo ========================================
echo 测试完成！
echo ========================================
pause
